#ifndef DATABASE_H
#define DATABASE_H
#include <string>
#include <utility>
#include <vector>
#include <map>
using namespace std;

struct news_entry{
	string title;
	string author;
	string text;
};

class database_interface{
	public:
	
	virtual bool create_newsgroup(string group) = 0;

	/* Creates a news entry, return id*/
	virtual pair<bool, unsigned int> put(const unsigned int group, const string title, const string author, const string text) = 0;

	/* Retrieves a news entry.*/
	virtual pair<int, map<string, string> > get(const unsigned int group_id, const unsigned int article_id) = 0;

	/* Removes a news entry.*/
	virtual int remove(const unsigned int group_id, const unsigned int article_id) = 0;

	virtual vector<pair<unsigned int, string> > get_newsgroups() = 0;

	virtual bool remove_newsgroup(const unsigned int group_id) = 0;

//	virtual vector<news_entry> get_news_entries(string group) = 0;
	virtual vector<pair<unsigned int, string> > get_news_entries(unsigned int group) = 0;


	private: 

};

#endif
